package hu.sulirend.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * A member of the Clazz.
 *
 * @author <a href="mailto: peter.szilagyi@gmail.com">Peter Szilagyi</a> 
 * @since 2008
 */
@Entity
public class Student extends BaseEntity {

	private static final long serialVersionUID = -7947022920713160791L;
	
	private String name;
	private Clazz clazz;
	private int startYear;
	
	@Column(unique=false, nullable=false, updatable=false, insertable=true)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@ManyToOne(optional=false, fetch=FetchType.LAZY, cascade={})
	@JoinColumn(name="CLAZZ_ID", referencedColumnName="id", unique=false, nullable=false, updatable=true, insertable=true)
	public Clazz getClazz() {
		return clazz;
	}
	public void setClazz(Clazz clazz) {
		this.clazz = clazz;
	}
	@Column(unique=false, nullable=false, updatable=false, insertable=true)
	public int getStartYear() {
		return startYear;
	}
	public void setStartYear(int startYear) {
		this.startYear = startYear;
	}
	
}
